from sqlalchemy.orm import *


from environ import session
from tables import *
from objects import *

session.mapper(User, user, properties=dict(
    groups=relation(Group, secondary=user_group, backref='users')
    ))
              
session.mapper(Group, group, properties=dict(
    permissions=relation(Permission, secondary=group_permission, backref='groups')
    ))

m = session.mapper(Permission, permission, properties=dict(
    ))

m.compile()
